<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>GrammarRule</title>
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="GrammarRule";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../mmj/verify/GrammarConstants.html" title="class in mmj.verify"><span class="strong">Prev Class</span></a></li>
<li><a href="../../mmj/verify/GrammaticalParser.html" title="interface in mmj.verify"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?mmj/verify/GrammarRule.html" target="_top">Frames</a></li>
<li><a href="GrammarRule.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">mmj.verify</div>
<h2 title="Class GrammarRule" class="title">Class GrammarRule</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>mmj.verify.GrammarRule</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../mmj/verify/NotationRule.html" title="class in mmj.verify">NotationRule</a>, <a href="../../mmj/verify/NullsPermittedRule.html" title="class in mmj.verify">NullsPermittedRule</a>, <a href="../../mmj/verify/TypeConversionRule.html" title="class in mmj.verify">TypeConversionRule</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="strong">GrammarRule</span>
extends java.lang.Object</pre>
<div class="block">GrammarRule is the superclass of NotationRule, NullsPermittedRule and
 TypeConversionRule.
 <p>
 Whew!!! The thing is a pantsload. I get tired just thinking about all this
 stuff.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../CreatingGrammarRulesFromSyntaxAxioms.html">
      CreatingGrammarRulesFromSyntaxAxioms.html</a>, 
<a href="../../ConsolidatedListOfGrammarValidations.html">
      ConsolidatedListOfGrammarValidations.html</a>, 
<a href="../../BasicsOfSyntaxAxiomsAndTypes.html">
      BasicsOfSyntaxAxiomsAndTypes.html</a>, 
<a href="../../EssentialAmbiguityExamples.html">
      EssentialAmbiguityExamples.html</a>, 
<a href="../../GrammarRuleTreeNotes.html"> GrammarRuleTreeNotes.html</a>, 
<a href="../../MetamathERNotes.html"> Nomenclature and
      Entity-Relationship Notes</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#isBaseRule">isBaseRule</a></strong></code>
<div class="block">isBaseRule indicates that the GrammarRule is derived directly from the
 baseSyntaxAxiom, and is unaffected by other NullsPermitted or
 TypeConversion GrammarRules.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.util.Comparator&lt;<a href="../../mmj/verify/GrammarRule.html" title="class in mmj.verify">GrammarRule</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#MAX_SEQ_NBR">MAX_SEQ_NBR</a></strong></code>
<div class="block">MAX_SEQ_NBR sequences by GrammarRule.maxSeqNbr & ruleNbr</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#maxSeqNbr">maxSeqNbr</a></strong></code>
<div class="block">maxSeqNbr is the greatest MObj(dot)seq of any Stmt in
 paramTransformationTree, and represents precedence since a statement's
 ParseTree should not refer to any Stmt's with sequence numbers higher
 than the Stmt's own sequence number.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#nbrHypParamsUsed">nbrHypParamsUsed</a></strong></code>
<div class="block">nbrHypParamsUsed == the number of hypotheses actually in use in the
 paramTransformationTree for the GrammarRule.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#paramTransformationTree">paramTransformationTree</a></strong></code>
<div class="block">paramTransformationTree is a ParseTree that is "splice onto" a set of
 Variable Hypotheses (if any) to produce a new sub-tree when a GrammarRule
 is matched to a sub-sequence of an expression.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#paramVarHypNode">paramVarHypNode</a></strong></code>
<div class="block">paramVarHypNode -- as unbelievable as this sounds -- has object
 references to the VarHyp ParseNode's in paramTransformationTree, thus
 eliminating most searches.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.util.Comparator&lt;<a href="../../mmj/verify/GrammarRule.html" title="class in mmj.verify">GrammarRule</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#RULE_NBR">RULE_NBR</a></strong></code>
<div class="block">RULE_NBR sequences by GrammarRule.ruleNbr</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#ruleFormatExpr">ruleFormatExpr</a></strong></code>
<div class="block">ruleFormatExpr contains the GrammarRule's Expression rewritten where each
 Var's VarHyp's Type Code replaces the Var or VarHyp (ie
 "( wff -> wff )").</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int[]</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#ruleHypPos">ruleHypPos</a></strong></code>
<div class="block">ruleHypPos[i] is an index of a VarHyp's position within ruleFormatExpr
 (helpful in EarleyParser).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#ruleNbr">ruleNbr</a></strong></code>
<div class="block">ruleNbr uniquely identifies a GrammarRule.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../mmj/verify/GrammarRule.html#GrammarRule()">GrammarRule</a></strong>()</code>
<div class="block">Default constructor.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../mmj/verify/GrammarRule.html#GrammarRule(mmj.verify.Grammar)">GrammarRule</a></strong>(<a href="../../mmj/verify/Grammar.html" title="class in mmj.verify">Grammar</a>&nbsp;grammar)</code>
<div class="block">Constructor -- create skeleton GrammarRule w/ruleNbr.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../mmj/verify/GrammarRule.html#GrammarRule(mmj.verify.Grammar, mmj.lang.Axiom)">GrammarRule</a></strong>(<a href="../../mmj/verify/Grammar.html" title="class in mmj.verify">Grammar</a>&nbsp;grammar,
           <a href="../../mmj/lang/Axiom.html" title="class in mmj.lang">Axiom</a>&nbsp;baseSyntaxAxiom)</code>
<div class="block">Constructor -- default GrammarRule for base Syntax Axioms, which means no
 parameter "transformations".</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#add(mmj.lang.Axiom, mmj.verify.Grammar)">add</a></strong>(<a href="../../mmj/lang/Axiom.html" title="class in mmj.lang">Axiom</a>&nbsp;baseSyntaxAxiom,
   <a href="../../mmj/verify/Grammar.html" title="class in mmj.verify">Grammar</a>&nbsp;grammar)</code>
<div class="block">Adds a Syntax Axiom's "base" grammar rule plus all derived grammar rules
 to the Grammar.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#addToGrammar(mmj.verify.Grammar, mmj.lang.Cnst[])">addToGrammar</a></strong>(<a href="../../mmj/verify/Grammar.html" title="class in mmj.verify">Grammar</a>&nbsp;grammar,
            <a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]&nbsp;ruleFormatExpr)</code>
<div class="block">Add rule format expression to the Rule Forest.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#buildGrammaticalParseNode(mmj.lang.ParseNodeHolder[])">buildGrammaticalParseNode</a></strong>(<a href="../../mmj/lang/ParseNodeHolder.html" title="class in mmj.lang">ParseNodeHolder</a>[]&nbsp;paramArray)</code>
<div class="block">Builds a grammatical parse node from the GrammarRule using an input array
 of parameters to substitute into the rule's variable hypotheses.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#buildRuleFormatExpr()">buildRuleFormatExpr</a></strong>()</code>
<div class="block">Build ruleFormatExpr version of the GrammarRule's expression.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#compareTo(java.lang.Object)">compareTo</a></strong>(java.lang.Object&nbsp;obj)</code>
<div class="block">Compares GrammarRule object based on the seq.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#deriveAdditionalRules(mmj.verify.Grammar)">deriveAdditionalRules</a></strong>(<a href="../../mmj/verify/Grammar.html" title="class in mmj.verify">Grammar</a>&nbsp;grammar)</code>
<div class="block">deriveAdditionalRules based on the addition of a new GrammarRule to those
 already generated and accepted.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#equals(java.lang.Object)">equals</a></strong>(java.lang.Object&nbsp;obj)</code>
<div class="block">Compare for equality with another GrammarRule.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#findMatchingVarHypTyp(int, mmj.lang.Cnst)">findMatchingVarHypTyp</a></strong>(int&nbsp;nextSearch,
                     <a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>&nbsp;searchTyp)</code>
<div class="block">Scans GrammarRule's paramVarHypNode array looking for a match to the
 input Type Code.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../mmj/lang/Axiom.html" title="class in mmj.lang">Axiom</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getBaseSyntaxAxiom()">getBaseSyntaxAxiom</a></strong>()</code>
<div class="block">Return GrammarRule's "base" Syntax Axiom.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract <a href="../../mmj/verify/GrammarRule.html" title="class in mmj.verify">GrammarRule</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getDupRule(mmj.verify.Grammar, mmj.lang.Cnst[])">getDupRule</a></strong>(<a href="../../mmj/verify/Grammar.html" title="class in mmj.verify">Grammar</a>&nbsp;grammar,
          <a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]&nbsp;ruleFormatExpr)</code>
<div class="block">Return a duplicate of the input ruleFormatExpr if it exists, or return
 null.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract <a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getForestRuleExpr()">getForestRuleExpr</a></strong>()</code>
<div class="block">Return the GrammarRule's ruleFormatExpr from the Rule Forest.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getGrammarRuleTyp()">getGrammarRuleTyp</a></strong>()</code>
<div class="block">Return GrammarRule's Type Code.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getIsBaseRule()">getIsBaseRule</a></strong>()</code>
<div class="block">Return GrammarRule's isBaseRule flag.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getMaxSeqNbr()">getMaxSeqNbr</a></strong>()</code>
<div class="block">Return GrammarRule's maxSeqNbr.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getNbrHypParamsUsed()">getNbrHypParamsUsed</a></strong>()</code>
<div class="block">Return GrammarRule's nbrHypParamsUsed.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getParamTransformationTree()">getParamTransformationTree</a></strong>()</code>
<div class="block">Return GrammarRule's paramTransformationTree.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getParamVarHypNode()">getParamVarHypNode</a></strong>()</code>
<div class="block">Return GrammarRule's paramVarHypNode array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseNodeHolder.html" title="class in mmj.lang">ParseNodeHolder</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getParseNodeHolderExpr()">getParseNodeHolderExpr</a></strong>()</code>
<div class="block">return parseNodeHolderExpr version of the GrammarRule's expression.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getRuleFormatExpr()">getRuleFormatExpr</a></strong>()</code>
<div class="block">Return GrammarRule's ruleFormatExpr.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getRuleFormatExprAsString()">getRuleFormatExprAsString</a></strong>()</code>
<div class="block">Return GrammarRule's ruleFormatExpr as String of Stmt labels.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getRuleFormatExprFirst()">getRuleFormatExprFirst</a></strong>()</code>
<div class="block">Return the first symbol of a GrammarRule's ruleFormatExpr.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getRuleFormatExprIthSymbol(int)">getRuleFormatExprIthSymbol</a></strong>(int&nbsp;i)</code>
<div class="block">Return the "i-th" symbol of a GrammarRule's ruleFormatExpr.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int[]</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getRuleHypPos()">getRuleHypPos</a></strong>()</code>
<div class="block">Return GrammarRule's ruleHypPos array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getRuleNbr()">getRuleNbr</a></strong>()</code>
<div class="block">Return GrammarRule's ruleNbr.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int[]</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#getSyntaxAxiomVarHypReseq()">getSyntaxAxiomVarHypReseq</a></strong>()</code>
<div class="block">Return GrammarRule's "base" Syntax Axiom's varHypReseq array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#hashCode()">hashCode</a></strong>()</code>
<div class="block">Computes hashcode for this GrammarRule.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#setIsBaseRule(boolean)">setIsBaseRule</a></strong>(boolean&nbsp;isBaseRule)</code>
<div class="block">Set GrammarRule's isBaseRule flag.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#setMaxSeqNbr(int)">setMaxSeqNbr</a></strong>(int&nbsp;maxSeqNbr)</code>
<div class="block">Set GrammarRule's maxSeqNbr.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#setNbrHypParamsUsed(int)">setNbrHypParamsUsed</a></strong>(int&nbsp;nbrHypParamsUsed)</code>
<div class="block">Set GrammarRule's nbrHypParamsUsed.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#setRuleFormatExpr(mmj.lang.Cnst[])">setRuleFormatExpr</a></strong>(<a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]&nbsp;rfe)</code>
<div class="block">Set GrammarRule's ruleFormatExpr.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../mmj/verify/GrammarRule.html#showRuleFormatExprAsString(mmj.lang.Cnst[])">showRuleFormatExprAsString</a></strong>(<a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]&nbsp;rfe)</code>
<div class="block">Return a GrammarRule's ruleFormatExpr as String of Stmt labels.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a name="ruleNbr">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ruleNbr</h4>
<pre>protected&nbsp;int ruleNbr</pre>
<div class="block">ruleNbr uniquely identifies a GrammarRule.
 <p>
 Rule Numbers are sssigned in sequence of rule creation, which corresponds
 to precedence -- that is, Metamath database sequence and how the Grammar
 Rules are generated.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../mmj/verify/Grammar.html#assignNextGrammarRuleNbr()"><code>Grammar.assignNextGrammarRuleNbr()</code></a></dd></dl>
</li>
</ul>
<a name="paramTransformationTree">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>paramTransformationTree</h4>
<pre>protected&nbsp;<a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a> paramTransformationTree</pre>
<div class="block">paramTransformationTree is a ParseTree that is "splice onto" a set of
 Variable Hypotheses (if any) to produce a new sub-tree when a GrammarRule
 is matched to a sub-sequence of an expression.
 <p>
 A GrammarRule may involve multiple Syntax Axioms including Type
 Conversions and Nulls Permitted Syntax Axioms. This means that a
 GrammarRule whose "base" Syntax Axiom has multiple variable hypotheses
 may, in practice require only a single variable hypothesis -- or none at
 all, due to Nulls Permitteds.
 <p>
 Note: <code>(Axiom)paramTransformationTree.getRoot().getStmt()</code> ==
 GrammarRule "baseSyntaxAxiom". Therefore, we are not storing the
 baseSyntaxAxiom redundantly as a separate element.</div>
</li>
</ul>
<a name="paramVarHypNode">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>paramVarHypNode</h4>
<pre>protected&nbsp;<a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>[] paramVarHypNode</pre>
<div class="block">paramVarHypNode -- as unbelievable as this sounds -- has object
 references to the VarHyp ParseNode's in paramTransformationTree, thus
 eliminating most searches.
 <p>
 The paramVarHypNode array has the same size as GrammarRule's base syntax
 axiom's var hyp array, but may contain null entries since a GrammarRule
 may require fewer parameters due to Nulls Permitted rule(s).</div>
</li>
</ul>
<a name="maxSeqNbr">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>maxSeqNbr</h4>
<pre>protected&nbsp;int maxSeqNbr</pre>
<div class="block">maxSeqNbr is the greatest MObj(dot)seq of any Stmt in
 paramTransformationTree, and represents precedence since a statement's
 ParseTree should not refer to any Stmt's with sequence numbers higher
 than the Stmt's own sequence number.</div>
</li>
</ul>
<a name="nbrHypParamsUsed">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nbrHypParamsUsed</h4>
<pre>protected&nbsp;int nbrHypParamsUsed</pre>
<div class="block">nbrHypParamsUsed == the number of hypotheses actually in use in the
 paramTransformationTree for the GrammarRule.
 <p>
 nbrHypParamsUsed may be less than the number of variable hypotheses for
 the base Syntax Axiom because the GrammarRule may employ nulls to
 "flesh out" the hypotheses for the base Syntax Axiom. Also, the number
 may be zero; this is the case for Constant Syntax Axioms and for Constant
 type Grammar Rules derived from Syntax Axioms where nulls are permitted.</div>
</li>
</ul>
<a name="ruleFormatExpr">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ruleFormatExpr</h4>
<pre>protected&nbsp;<a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[] ruleFormatExpr</pre>
<div class="block">ruleFormatExpr contains the GrammarRule's Expression rewritten where each
 Var's VarHyp's Type Code replaces the Var or VarHyp (ie
 "( wff -> wff )").
 <p>
 This was a late addition to GrammarRule caused by the need of
 EarleyParser's Predictor and Lookahead to know the first symbol of a
 GrammarRule. To save further searching, perhaps expensive marches through
 the Grammar Rule Forest, I decided to add the entire ruleFormatExpr here.
 Given that the entire expression is now stored in GrammarRule and that
 there are cheaper ways to find duplicates than traipsing through the
 Grammar Rule Forest -- and EarleyParser does not require the Forest for
 its work -- there are few impediments to eliminating the Forest
 altogether (just need to rework mmj.util.Dump a bit, I think.)
 <p></div>
</li>
</ul>
<a name="ruleHypPos">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ruleHypPos</h4>
<pre>protected&nbsp;int[] ruleHypPos</pre>
<div class="block">ruleHypPos[i] is an index of a VarHyp's position within ruleFormatExpr
 (helpful in EarleyParser).
 <p>
 Array length = nbrHypParamsUsed and is sequenced by hyp position within
 the ruleFormatExpr.</div>
</li>
</ul>
<a name="isBaseRule">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isBaseRule</h4>
<pre>protected&nbsp;boolean isBaseRule</pre>
<div class="block">isBaseRule indicates that the GrammarRule is derived directly from the
 baseSyntaxAxiom, and is unaffected by other NullsPermitted or
 TypeConversion GrammarRules.
 <p>
 It is here for the eventuality that we'll use an EarleyParser that
 handles its own NullsPermitted and TypeConversion rules (otherwise, it
 can say adios).</div>
</li>
</ul>
<a name="RULE_NBR">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>RULE_NBR</h4>
<pre>public static final&nbsp;java.util.Comparator&lt;<a href="../../mmj/verify/GrammarRule.html" title="class in mmj.verify">GrammarRule</a>&gt; RULE_NBR</pre>
<div class="block">RULE_NBR sequences by GrammarRule.ruleNbr</div>
</li>
</ul>
<a name="MAX_SEQ_NBR">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>MAX_SEQ_NBR</h4>
<pre>public static final&nbsp;java.util.Comparator&lt;<a href="../../mmj/verify/GrammarRule.html" title="class in mmj.verify">GrammarRule</a>&gt; MAX_SEQ_NBR</pre>
<div class="block">MAX_SEQ_NBR sequences by GrammarRule.maxSeqNbr & ruleNbr</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="GrammarRule()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>GrammarRule</h4>
<pre>public&nbsp;GrammarRule()</pre>
<div class="block">Default constructor.</div>
</li>
</ul>
<a name="GrammarRule(mmj.verify.Grammar)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>GrammarRule</h4>
<pre>public&nbsp;GrammarRule(<a href="../../mmj/verify/Grammar.html" title="class in mmj.verify">Grammar</a>&nbsp;grammar)</pre>
<div class="block">Constructor -- create skeleton GrammarRule w/ruleNbr.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>grammar</code> - The Grammar.</dd></dl>
</li>
</ul>
<a name="GrammarRule(mmj.verify.Grammar, mmj.lang.Axiom)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>GrammarRule</h4>
<pre>public&nbsp;GrammarRule(<a href="../../mmj/verify/Grammar.html" title="class in mmj.verify">Grammar</a>&nbsp;grammar,
           <a href="../../mmj/lang/Axiom.html" title="class in mmj.lang">Axiom</a>&nbsp;baseSyntaxAxiom)</pre>
<div class="block">Constructor -- default GrammarRule for base Syntax Axioms, which means no
 parameter "transformations".</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>grammar</code> - The Grammar.</dd><dd><code>baseSyntaxAxiom</code> - Syntax Axiom.</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="addToGrammar(mmj.verify.Grammar, mmj.lang.Cnst[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addToGrammar</h4>
<pre>public abstract&nbsp;void&nbsp;addToGrammar(<a href="../../mmj/verify/Grammar.html" title="class in mmj.verify">Grammar</a>&nbsp;grammar,
                <a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]&nbsp;ruleFormatExpr)</pre>
<div class="block">Add rule format expression to the Rule Forest.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>grammar</code> - The Grammar object (Mr Big).</dd><dd><code>ruleFormatExpr</code> - the expression to add.</dd></dl>
</li>
</ul>
<a name="deriveAdditionalRules(mmj.verify.Grammar)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deriveAdditionalRules</h4>
<pre>public abstract&nbsp;void&nbsp;deriveAdditionalRules(<a href="../../mmj/verify/Grammar.html" title="class in mmj.verify">Grammar</a>&nbsp;grammar)</pre>
<div class="block">deriveAdditionalRules based on the addition of a new GrammarRule to those
 already generated and accepted.
 <p>
 A PriorityQueue is used to store new derivedGrammarRules awaiting
 processing (dup checking, parse checking and possible addition to the
 Grammar data.) The Comparator orders derived rules based on MaxSeqNbr and
 ruleNbr so that low Metamath sequence number statements are added to the
 Grammar before higher sequenced statements. The existing rules are stored
 in separate repositories, which are scanned, as needed, when a new rule
 is added; the order that the repositories are scanned is irrelevant
 because the PriorityQueue controls update processing sequence.
 <p>
 Note also that a newly derived rule may generate other derived rules,
 which in turn trigger other derivations; this is a "feature" (as well as
 a scary opportunity for an infinite loop!) The benefit is that each pair
 of rules may be considered separately; when processing the pair there is
 no need to worry about other possible Type Conversion and Null Permitted
 Rules. For example, an "A" Type hypothesis in a Notation Rule may be the
 target of a "B to A" Type Conversion, but the fact that there is a
 "C to B" or "C to A" conversion can be ignored -- if the "B to A"
 conversion generates a variant rule of the original rule, then when
 *that* rule comes back through the PriorityQueue, the "C to B" rule will
 automatically come into play. This also means that a "B to A" conversion
 will combine with a "C to B" conversion to generate a "C to A" conversion
 -- eventually.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>grammar</code> - The Grammar.</dd></dl>
</li>
</ul>
<a name="getDupRule(mmj.verify.Grammar, mmj.lang.Cnst[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDupRule</h4>
<pre>public abstract&nbsp;<a href="../../mmj/verify/GrammarRule.html" title="class in mmj.verify">GrammarRule</a>&nbsp;getDupRule(<a href="../../mmj/verify/Grammar.html" title="class in mmj.verify">Grammar</a>&nbsp;grammar,
                     <a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]&nbsp;ruleFormatExpr)</pre>
<div class="block">Return a duplicate of the input ruleFormatExpr if it exists, or return
 null.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>grammar</code> - The Grammar.</dd><dd><code>ruleFormatExpr</code> - the expression to add.</dd>
<dt><span class="strong">Returns:</span></dt><dd>GrammarRule if duplicate found, or null.</dd></dl>
</li>
</ul>
<a name="getForestRuleExpr()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getForestRuleExpr</h4>
<pre>public abstract&nbsp;<a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]&nbsp;getForestRuleExpr()</pre>
<div class="block">Return the GrammarRule's ruleFormatExpr from the Rule Forest.
 <p>
 This is pretty obsolete now that ruleFormatExpr is stored in GrammarRule,
 but it is still used in Dump (for now).</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>ruleFormatExpr GrammarRule Expression in rule format.</dd></dl>
</li>
</ul>
<a name="add(mmj.lang.Axiom, mmj.verify.Grammar)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre>public static&nbsp;boolean&nbsp;add(<a href="../../mmj/lang/Axiom.html" title="class in mmj.lang">Axiom</a>&nbsp;baseSyntaxAxiom,
          <a href="../../mmj/verify/Grammar.html" title="class in mmj.verify">Grammar</a>&nbsp;grammar)</pre>
<div class="block">Adds a Syntax Axiom's "base" grammar rule plus all derived grammar rules
 to the Grammar.
 <p>
 This is a major function in GrammarRule. Hairy.
 <p>
 Checks for Type Conversion "loop" on Syntax Axiom base Grammar Rule,</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>baseSyntaxAxiom</code> - Syntax Axiom.</dd><dd><code>grammar</code> - The Grammar.</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if rule added successfully, else false.</dd></dl>
</li>
</ul>
<a name="hashCode()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode</h4>
<pre>public&nbsp;int&nbsp;hashCode()</pre>
<div class="block">Computes hashcode for this GrammarRule.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>hashCode</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>
<dt><span class="strong">Returns:</span></dt><dd>hashcode for the GrammarRule</dd></dl>
</li>
</ul>
<a name="compareTo(java.lang.Object)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>compareTo</h4>
<pre>public&nbsp;int&nbsp;compareTo(java.lang.Object&nbsp;obj)</pre>
<div class="block">Compares GrammarRule object based on the seq.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>obj</code> - GrammarRule object to compare to this GrammarRule</dd>
<dt><span class="strong">Returns:</span></dt><dd>returns negative, zero, or a positive int if this GrammarRule
         object is less than, equal to or greater than the input parameter
         obj.</dd></dl>
</li>
</ul>
<a name="equals(java.lang.Object)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre>public&nbsp;boolean&nbsp;equals(java.lang.Object&nbsp;obj)</pre>
<div class="block">Compare for equality with another GrammarRule.
 <p>
 Equal if and only if the GrammarRule sequence numbers are equal. and the
 obj to be compared to this object is not null and is a GrammarRule as
 well.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>equals</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>
<dt><span class="strong">Returns:</span></dt><dd>returns true if equal, otherwise false.</dd></dl>
</li>
</ul>
<a name="getRuleNbr()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRuleNbr</h4>
<pre>public&nbsp;int&nbsp;getRuleNbr()</pre>
<div class="block">Return GrammarRule's ruleNbr.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>GrammarRule's ruleNbr.</dd></dl>
</li>
</ul>
<a name="getParamTransformationTree()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getParamTransformationTree</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang">ParseTree</a>&nbsp;getParamTransformationTree()</pre>
<div class="block">Return GrammarRule's paramTransformationTree.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>GrammarRule's paramTransformationTree.</dd></dl>
</li>
</ul>
<a name="getParamVarHypNode()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getParamVarHypNode</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>[]&nbsp;getParamVarHypNode()</pre>
<div class="block">Return GrammarRule's paramVarHypNode array.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>GrammarRule's paramVarHypNode array.</dd></dl>
</li>
</ul>
<a name="getMaxSeqNbr()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxSeqNbr</h4>
<pre>public&nbsp;int&nbsp;getMaxSeqNbr()</pre>
<div class="block">Return GrammarRule's maxSeqNbr.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>GrammarRule's maxSeqNbr.</dd></dl>
</li>
</ul>
<a name="setMaxSeqNbr(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMaxSeqNbr</h4>
<pre>public&nbsp;void&nbsp;setMaxSeqNbr(int&nbsp;maxSeqNbr)</pre>
<div class="block">Set GrammarRule's maxSeqNbr.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>maxSeqNbr</code> - GrammarRule's maxSeqNbr.</dd></dl>
</li>
</ul>
<a name="getNbrHypParamsUsed()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNbrHypParamsUsed</h4>
<pre>public&nbsp;int&nbsp;getNbrHypParamsUsed()</pre>
<div class="block">Return GrammarRule's nbrHypParamsUsed.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>GrammarRule's nbrHypParamsUsed.</dd></dl>
</li>
</ul>
<a name="setNbrHypParamsUsed(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setNbrHypParamsUsed</h4>
<pre>public&nbsp;void&nbsp;setNbrHypParamsUsed(int&nbsp;nbrHypParamsUsed)</pre>
<div class="block">Set GrammarRule's nbrHypParamsUsed.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>nbrHypParamsUsed</code> - GrammarRule's nbrHypParamsUsed.</dd></dl>
</li>
</ul>
<a name="getBaseSyntaxAxiom()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBaseSyntaxAxiom</h4>
<pre>public&nbsp;<a href="../../mmj/lang/Axiom.html" title="class in mmj.lang">Axiom</a>&nbsp;getBaseSyntaxAxiom()</pre>
<div class="block">Return GrammarRule's "base" Syntax Axiom.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>GrammarRule's "base" Syntax Axiom.</dd></dl>
</li>
</ul>
<a name="getSyntaxAxiomVarHypReseq()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSyntaxAxiomVarHypReseq</h4>
<pre>public&nbsp;int[]&nbsp;getSyntaxAxiomVarHypReseq()</pre>
<div class="block">Return GrammarRule's "base" Syntax Axiom's varHypReseq array.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>GrammarRule's "base" Syntax Axiom's varHypReseq array.</dd></dl>
</li>
</ul>
<a name="getGrammarRuleTyp()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getGrammarRuleTyp</h4>
<pre>public&nbsp;<a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>&nbsp;getGrammarRuleTyp()</pre>
<div class="block">Return GrammarRule's Type Code.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>GrammarRule's Type Code.</dd></dl>
</li>
</ul>
<a name="getRuleHypPos()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRuleHypPos</h4>
<pre>public&nbsp;int[]&nbsp;getRuleHypPos()</pre>
<div class="block">Return GrammarRule's ruleHypPos array.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>GrammarRule's ruleHypPos array.</dd></dl>
</li>
</ul>
<a name="getRuleFormatExpr()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRuleFormatExpr</h4>
<pre>public&nbsp;<a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]&nbsp;getRuleFormatExpr()</pre>
<div class="block">Return GrammarRule's ruleFormatExpr.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>GrammarRule's ruleFormatExpr.</dd></dl>
</li>
</ul>
<a name="setRuleFormatExpr(mmj.lang.Cnst[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRuleFormatExpr</h4>
<pre>public&nbsp;void&nbsp;setRuleFormatExpr(<a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]&nbsp;rfe)</pre>
<div class="block">Set GrammarRule's ruleFormatExpr.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>rfe</code> - GrammarRule's ruleFormatExpr.</dd></dl>
</li>
</ul>
<a name="getRuleFormatExprAsString()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRuleFormatExprAsString</h4>
<pre>public&nbsp;java.lang.String&nbsp;getRuleFormatExprAsString()</pre>
<div class="block">Return GrammarRule's ruleFormatExpr as String of Stmt labels.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>GrammarRule's ruleFormatExpr as String.</dd></dl>
</li>
</ul>
<a name="showRuleFormatExprAsString(mmj.lang.Cnst[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>showRuleFormatExprAsString</h4>
<pre>public static&nbsp;java.lang.String&nbsp;showRuleFormatExprAsString(<a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]&nbsp;rfe)</pre>
<div class="block">Return a GrammarRule's ruleFormatExpr as String of Stmt labels.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>rfe</code> - ruleFormatExpr.</dd>
<dt><span class="strong">Returns:</span></dt><dd>GrammarRule's ruleFormatExpr as String.</dd></dl>
</li>
</ul>
<a name="getRuleFormatExprFirst()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRuleFormatExprFirst</h4>
<pre>public&nbsp;<a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>&nbsp;getRuleFormatExprFirst()</pre>
<div class="block">Return the first symbol of a GrammarRule's ruleFormatExpr.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>first symbol of a GrammarRule's ruleFormatExpr.</dd></dl>
</li>
</ul>
<a name="getRuleFormatExprIthSymbol(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRuleFormatExprIthSymbol</h4>
<pre>public&nbsp;<a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>&nbsp;getRuleFormatExprIthSymbol(int&nbsp;i)</pre>
<div class="block">Return the "i-th" symbol of a GrammarRule's ruleFormatExpr.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>i</code> - the index</dd>
<dt><span class="strong">Returns:</span></dt><dd>i-th symbol of a GrammarRule's ruleFormatExpr or null of i is
         beyond the end of the expression.</dd></dl>
</li>
</ul>
<a name="getIsBaseRule()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIsBaseRule</h4>
<pre>public&nbsp;boolean&nbsp;getIsBaseRule()</pre>
<div class="block">Return GrammarRule's isBaseRule flag.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>GrammarRule's isBaseRule flag.</dd></dl>
</li>
</ul>
<a name="setIsBaseRule(boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setIsBaseRule</h4>
<pre>public&nbsp;void&nbsp;setIsBaseRule(boolean&nbsp;isBaseRule)</pre>
<div class="block">Set GrammarRule's isBaseRule flag.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>isBaseRule</code> - flag.</dd></dl>
</li>
</ul>
<a name="getParseNodeHolderExpr()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getParseNodeHolderExpr</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseNodeHolder.html" title="class in mmj.lang">ParseNodeHolder</a>[]&nbsp;getParseNodeHolderExpr()</pre>
<div class="block">return parseNodeHolderExpr version of the GrammarRule's expression.
 <p>
 The root of a GrammarRule paramTransformationTree is always the
 baseSyntaxAxiom. Since no Syntax Axiom may be a composite function that
 is parseable into other Syntax Axiom rules, the only possible
 substitution into a *grammar rule* variable is 1) another variable via a
 Type Conversion Rule or 2) null, via a Nulls Permitted Rule. And, since
 GrammarRule contains the paramVarHypNode array we can directly write out
 the resulting formula and/or ruleFormatExpr and/or ParseNodeHolderExpr --
 an element of paramVarHypNode == null *must be* a null substitution, by
 virtue of the above considerations.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>parseNodeHolder format expression.</dd></dl>
</li>
</ul>
<a name="buildRuleFormatExpr()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>buildRuleFormatExpr</h4>
<pre>public&nbsp;<a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]&nbsp;buildRuleFormatExpr()</pre>
<div class="block">Build ruleFormatExpr version of the GrammarRule's expression.
 <p>
 This is a clone of GrammarRule.getParseNodeHolderExpr() with a different
 output format, essentially.
 <p>
 The root of a GrammarRule paramTransformationTree is always the
 baseSyntaxAxiom. Since no Syntax Axiom may be a composite function that
 is parseable into other Syntax Axiom rules, the only possible
 substitution into a *grammar rule* variable is 1) another variable via a
 Type Conversion Rule or 2) null, via a Nulls Permitted Rule. And, since
 GrammarRule contains the paramVarHypNode array we can directly write out
 the resulting formula and/or ruleFormatExpr and/or ParseNodeHolderExpr --
 an element of paramVarHypNode == null *must be* a null substitution, by
 virtue of the above considerations.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>ruleFormatExpr expression.</dd></dl>
</li>
</ul>
<a name="buildGrammaticalParseNode(mmj.lang.ParseNodeHolder[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>buildGrammaticalParseNode</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>&nbsp;buildGrammaticalParseNode(<a href="../../mmj/lang/ParseNodeHolder.html" title="class in mmj.lang">ParseNodeHolder</a>[]&nbsp;paramArray)</pre>
<div class="block">Builds a grammatical parse node from the GrammarRule using an input array
 of parameters to substitute into the rule's variable hypotheses.
 <p>
 This is a rude dog.
 <p>
 buildGrammaticalParseNode -- pads out the parameter list as needed (for
 nulls in the rule) and resequences the parameters from the symbol
 sequence order to the database sequence order used by Metamath for
 statement hypotheses. Then the parameters are substituted into the
 GrammarRule's parameterTransformationTree, which is basically a model
 parse sub-tree for the GrammarRule, requiring only replacement of the
 GrammarRule's variable hypotheses with the input parameters. Note that
 the variable hypothesis nodes for a grammar rule are at the bottom of the
 tree (true for all parse trees), and this means that we are splicing in
 the parameters at the bottom, building up a larger tree that contains the
 grammar rule at the top of the tree.
 <p>
 NOTE: Originally, the GrammarRule design didn't call for the parameter
 transformation data to be stored in a parse tree. But, in highly unusual
 grammars using Nulls Permitted, a Syntax Axiom with two variable
 hypotheses generates a Type Conversion Rule. With one of the hypotheses =
 null, a Syntax Axiom containing no constants in the expression and two
 variables generates a Type Conversion Grammar Rule. So.....we carry
 around this stinking tree structure that may contain Type Conversions and
 Nulls Permitted transformations along with variable hypotheses that are
 to be substituted. In other words, blame Nulls Permitted for this
 complexificationizing.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>paramArray</code> - substitutions for variable hypothesis nodes of the
            Grammar Rule's paramTransformationTree.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the output ParseNode</dd></dl>
</li>
</ul>
<a name="findMatchingVarHypTyp(int, mmj.lang.Cnst)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>findMatchingVarHypTyp</h4>
<pre>protected&nbsp;int&nbsp;findMatchingVarHypTyp(int&nbsp;nextSearch,
                        <a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>&nbsp;searchTyp)</pre>
<div class="block">Scans GrammarRule's paramVarHypNode array looking for a match to the
 input Type Code.
 <p>
 This is a key function used in deriving additional rules using a
 TypeConversionRule or NullsPermittedRule.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>nextSearch</code> - starting index of search.</dd><dd><code>searchTyp</code> - Type Code sought among paramVarHypNodes.</dd>
<dt><span class="strong">Returns:</span></dt><dd>index of node in paramVarHypNode with matching type or -1 if not
         found.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - only if there is a severe bug in the code
             (which performs a double-check here just to be on the safe
             side -- we'd rather have a blow-up than deliver bogus
             answers?)</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../mmj/verify/GrammarConstants.html" title="class in mmj.verify"><span class="strong">Prev Class</span></a></li>
<li><a href="../../mmj/verify/GrammaticalParser.html" title="interface in mmj.verify"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?mmj/verify/GrammarRule.html" target="_top">Frames</a></li>
<li><a href="GrammarRule.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
